import 'normalize.css'
import './assets/css/index.less'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from './storage'

// 需要单独引入样式
import 'element-plus/theme-chalk/el-message.css'
// 全量注册组件
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'
// createApp(App).use(router).mount('#app')

// 全局注册图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 刷新路由
import useLoginStore from './storage/login/login'

const app = createApp(App)

// 以下路由是放在pinia中的 所以这里必须放在上面
app.use(pinia)

// app.use(ElementPlus) // 全量引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
const localStorage = useLoginStore()
localStorage.locaCacheAction()

// 路由必须放在重新加载路由之后
app.use(router)

app.mount('#app')
